package app.species.ANN;

public class InputNeuron extends Neuron{

	private static final long serialVersionUID = -258783409826387190L;
	private double input;
	private int usageID = 0;

	public InputNeuron(Soma s, int useID, Axon[] in, Axon[] out){
		super(s, in, out);
		this.soma.setActive(true);
		usageID = useID;
	}

	public void setInput(double in){
		this.input = in;
	}

	public void fire(){
		//TODO: Collect input from incoming axons
		//TODO: allow incoming axons for input neurons. DISCUSS and EVALUATE this

		this.soma.input = this.input;
		this.soma.activate();

		for(int i = 0; i < this.outgoingAxons.length; i++){
			this.outgoingAxons[i].input = this.soma.output;
		}

	}
	
	public void setUsageID(int ID){
		assert(ID >= 0):"negative usageID not allowed: " + ID;
		usageID = ID;		
	}
	public int getUsageID(){
		return usageID;
	}
	
	public Soma getSoma(){
		return soma;
	}

}
